Bom Flaah como você tem a função do CreateCustomMonster creio que dara certo entao, vamos lá:
1º Crie um arquivo na pasta talkactions/scripts com o nome de clone.lua e coloque em seu conteúdo:
local spells = {
[1] = {used = 0, text = '<attack name="melee" interval="2000" chance="100" range="5" radius="1" target="0"><attribute key="areaEffect" value="fire"/></attack>'},
[2] = {used = 0, text = '<attack name="melee" interval="1200" chance="100" range="5" radius="1" target="0"><attribute key="areaEffect" value="energyarea"/></attack>'},
[3] = {used = 0, text = '<attack name="melee" interval="700" chance="100" range="5" radius="1" target="0"><attribute key="areaEffect" value="mortarea"/></attack>'}
}
local spellsNumber = 2
function randomNum(range)
local rand = 0
good = false
math.randomseed( os.time() )
math.random()
math.random()
math.random()
while (not good) do
rand = math.random(range)
if (spells[rand].used == 0) then
spells[rand].used = 1
good = true
else
good = false
end
end
return rand
end
function onSay(cid, words)
local attacks = "<a>"
local num
for i=1,spellsNumber,1 do
num = randomNum(table.getn(spells))
attacks = attacks .. spells[num].text
end
attacks = attacks .. "</a>"
doCreateCustomMonster(getCreatureName(cid), getCreaturePosition(cid), getCreatureOutfit(cid), getCreatureMaxHealth(cid), attacks, 6324, 1, 100)
for i=1,table.getn(spells),1 do
spells[i].used = 0
end
attacks = ""
return true
end
Explicando:
doCreateCustomMonster(nome, posição, outfit, health, attacks, corpo quando morto, distancia do player, experiencia)
2º Abra o arquivo talkactions.xml e adicione em qualquer lugar:
<talkaction words="!clone" event="script" value="clone.lua"/>
Te ajudei REP+.





info
Grupo: Barão
Registrado: 26/12/11
Posts: 201
Reputação: +18
Char no Tibia: Flaah
Ola amigos do XTIBIA, hoje eu vim aqui pra pedi uma ajudinha para vcs, que seria:
Vcs conseguiriam colocar as funçoes:
Na SPELL que eu editei:
SPELL original:
function onCastSpell(cid, var) local playerpos = getPlayerPosition(cid) local cloth = getCreatureOutfit(cid) local health = getCreatureHealth(cid) local maxhealth = getCreatureMaxHealth(cid) local MaximoSummon = 10 --- Maximo de Monstros Sumonados!! No Caso So Posso Sumonar 5 Clones local summons = getCreatureSummons(cid) if(table.maxn(summons) < MaximoSummon) then -- no summons local clone = doCreateMonster("orc", playerpos) doConvinceCreature(cid, clone) setCreatureMaxHealth(clone, maxhealth) doCreatureAddHealth(clone, health) doSetCreatureOutfit(clone, cloth, -1) doSendMagicEffect(playerpos, 2) return TRUE end endEm?!
Sobre a função: http://www.xtibia.co...ommonster-no-c/
PS: EU TENHO A FUNÇÃO doCreateCustomMonster NO MEU SERVER.
ERRO QUE ESTA DANDO: Quando eu uso a spell que eu editei com esse comando, ele derruba o server.
ALGUEM AJUDA PORFAVOR, VALENDO +REP
Editado Agosto 15 por Flaah